/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package escr.persistencia;

import java.io.Serializable;
import java.util.Collection;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author Aditardo
 */
@Entity
@Table(name = "titulomenu")
@NamedQueries({@NamedQuery(name = "Titulomenu.findByIdTitumenu", query = "SELECT t FROM Titulomenu t WHERE t.idTitumenu = :idTitumenu"), @NamedQuery(name = "Titulomenu.findByNombreTitumenu", query = "SELECT t FROM Titulomenu t WHERE t.nombreTitumenu = :nombreTitumenu")})
public class Titulomenu implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Column(name = "idTitumenu", nullable = false)
    private Integer idTitumenu;
    @Column(name = "nombreTitumenu")
    private String nombreTitumenu;
    @OneToMany(mappedBy = "idTitumenu")
    private Collection<Submenu> submenuCollection;

    public Titulomenu() {
    }

    public Titulomenu(Integer idTitumenu) {
        this.idTitumenu = idTitumenu;
    }

    public Integer getIdTitumenu() {
        return idTitumenu;
    }

    public void setIdTitumenu(Integer idTitumenu) {
        this.idTitumenu = idTitumenu;
    }

    public String getNombreTitumenu() {
        return nombreTitumenu;
    }

    public void setNombreTitumenu(String nombreTitumenu) {
        this.nombreTitumenu = nombreTitumenu;
    }

    public Collection<Submenu> getSubmenuCollection() {
        return submenuCollection;
    }

    public void setSubmenuCollection(Collection<Submenu> submenuCollection) {
        this.submenuCollection = submenuCollection;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idTitumenu != null ? idTitumenu.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Titulomenu)) {
            return false;
        }
        Titulomenu other = (Titulomenu) object;
        if ((this.idTitumenu == null && other.idTitumenu != null) || (this.idTitumenu != null && !this.idTitumenu.equals(other.idTitumenu))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "escr.persistencia.Titulomenu[idTitumenu=" + idTitumenu + "]";
    }

}
